package com.woniuxy.happylife.controller;

import com.woniuxy.happylife.entity.MallCategory;
import com.woniuxy.happylife.entity.ResponseEntity;
import com.woniuxy.happylife.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author:roger
 * @Date:2022/2/19 10:06:57
 * @Description:
 */
@RestController
@RequestMapping("/category")
public class CategoryController {
    @Autowired
    CategoryService categoryService;
    @GetMapping("/")
    public ResponseEntity<List<MallCategory>> getAll(){
        return new ResponseEntity<List<MallCategory>>(200,"获取到所有的分类",categoryService.getAll());
    }
}
